using System;
using System.Collections.Generic;
using System.Text;
using Instedd.Labs.Geo.Library.Kml;


namespace Instedd.Labs.Geo.Library.Rss
{
    public class Item
    {
        private String creator;

        public String Creator
        {
            get { return creator; }
            set { creator = value; }
        }

        private String title;
        private String description;
        private DateTime pubDate;
        private String link;
        private List<Comment> comments = null;
        private LatLong latLong;
        private Guid id;

        public Guid Id
        {
            get { return id; }
            set { id = value; }
        }


        public Item(Guid id, String creator, String title, String description, DateTime pubDate, String link, LatLong latLong, List<Comment> comments)
        {
            this.id = id;
            this.creator = creator;
            this.title = title;
            this.description = description;
            this.pubDate = pubDate;
            this.link = link;
            this.latLong = latLong;
            if (comments == null)
            {
                this.comments = new List<Comment>();
            }
            else
            {
                this.comments = comments;
            }
        }

        public List<Comment> Comments
        {
            get { return comments; }
        }
	
        public String Link
        {
            get { return link; }
            set { link = value; }
        }

        public DateTime PubDate
        {
            get { return pubDate; }
            set { pubDate = value; }
        }

        public String Description
        {
            get { return description; }
            set { description = value; }
        }

        public String Title
        {
            get { return title; }
            set { title = value; }
        }

        public LatLong LatLong
        {
            get { return latLong; }
            set { latLong = value; }
        }

        private Line line;

        public Line Line
        {
            get { return line; }
            set { line = value; }
        }

        // NOTE: this property is here just to ease ASP.Net databinding
        // TODO: remove this property and modify the databinding used on default.aspx markup
        public int CommentsCount
        {
            get
            {
                return comments.Count;
            }
        }

    }
}
